<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<link rel="stylesheet" type="text/css" href="resources/css/style.css">
		<script src="resources/js/comm.js"></script>
		<script type="text/javascript" src="resources/js/imgPreview/CJL.0.1.min.js"></script>
		<script type="text/javascript" src="resources/js/imgPreview/ImagePreviewd.js"></script>
		<script type="text/javascript">
	function checkForm() {
		var apk = $("apk").value;
		if(apk == "" || !checkPic(apk)){
			alert("请您选择正确文件类型\n 必须为jpg或png");   
		} else {
			loading();
			submitForm("addform");
		}
	}
</script>
	</head>

	<body onkeydown="if(event.keyCode==27) return false;">
		<jsp:include page="../inc/header.jsp"></jsp:include>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30" background="resources/images/other/tab_05.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="30">
								<img src="resources/images/other/tab_03.gif" width="12"
									height="30" />
							</td>
							<td>
								<div class="page_title">
									<img align="middle" src="resources/images/other/tb.gif"
										width="16" height="16" />
									重新上传ICON
								</div>
							</td>
							<td>
								<div class="button_bar">
									<input value="返回" type="button" id="btn_back" class="common_button" onclick="javascript:history.go(-1);loading();">
									<input value="重新上传" type="button" id="btn_ok" class="common_button" onclick="checkForm();">
									<input value="刷新" type="button" id="btn_re" class="common_button" onclick="location='software.do?method=toICON&id=${id}';loading();">
								</div>
							</td>
							<td width="16" height="30">
								<img src="resources/images/other/tab_07.gif" width="16"
									height="30" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="8" background="resources/images/other/tab_12.gif">
							</td>
							<td>
								<form action="software.do" method="post" id="addform" enctype="multipart/form-data">
									<input type="hidden" name="method" value="doICON">
									<input type="hidden" name="id" value="${id }">
									<table cellspacing="1" cellpadding="0" class="query_form_table">
									<tr>
										<th><b>上传ICON文件</b></th>
										<td>
											<input class="comm_input" type="file" name="icon" id="apk"/>
											<span class="red_star">*</span>
										</td>
									</tr>
									<tr>
										<th>
											图标展示
										</th>
										<td>
											<img alt="" id="showimg" width="70" height="70"/>
										</td>
									</tr>										
									</table>
								</form>
							</td>
							<td width="8" background="resources/images/other/tab_15.gif">
							</td>
						</tr>
						<tr>
							<td width="8" background="resources/images/other/tab_12.gif"></td>
							<td>&nbsp;</td>
							<td width="8" background="resources/images/other/tab_15.gif"></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="35" background="resources/images/other/tab_19.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="30">
								<img src="resources/images/other/tab_18.gif" width="12"
									height="35" />
							</td>
							<td>
								&nbsp;
							</td>
							<td width="16">
								<img src="resources/images/other/tab_20.gif" width="16"
									height="35" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>
<script>
var ip = new ImagePreview( $$("apk"), $$("showimg"), {
 maxWidth: 70, maxHeight: 70
});
//ip.img.src = ImagePreview.TRANSPARENT;
ip.file.onchange = function(){ ip.img.src="";ip.preview(); };

</script>
<jsp:include page="../inc/footer.jsp"></jsp:include>